package com.lanou.service.impl;

import com.lanou.bean.Account;
import com.lanou.mapper.AccountMapper;
import com.lanou.mapper.ServiceMapper;
import com.lanou.service.ServiceService;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;

/**
 * Created by dllo on 18/3/16.
 */
@Service
public class ServiceServiceImpl implements ServiceService {
    //dd
    @Resource
    ServiceMapper serviceMapper;
    @Override
    public void deleteServiceByAccount(int id) {
        serviceMapper.deleteServiceByAccount(id);
    }

    @Override
    public List<com.lanou.bean.Service> selectAllBill() {
        return serviceMapper.selectAllBill();
    }

    @Override
    public com.lanou.bean.Service selectAllBillById(int id) {
        return serviceMapper.selectAllBillById(id);
    }

    @Override
    public List<com.lanou.bean.Service> selectAllService() {
        return serviceMapper.selectAllService();
    }

    @Override
    public com.lanou.bean.Service selectServiceByServiceId(int id) {
        return serviceMapper.selectServiceByServiceId(id);
    }

    @Override
    public void delectService(int id) {
        serviceMapper.delectService(id);
    }




    @Override
    public void updateStatu(int id, String status) {
        serviceMapper.updateStatu(id, status);
    }

    @Override
    public void updataService(int id, int costid) {
    serviceMapper.updataService(id, costid);
    }

    @Override
    public void updataServiceByaccountId(int id, String statu) {
        serviceMapper.updataServiceByaccountId(id, statu);
    }

    @Override
    public void insertService(com.lanou.bean.Service service) {
        serviceMapper.insertService(service);
    }

    @Override
    public List<com.lanou.bean.Service> selectByOSName(String osName, String ip,String card,String status) {
        if (ip==""){
            ip=null;
        }
        if (card==""){
            card=null;
        }
        if (osName==""){
            osName=null;
        }
        return serviceMapper.selectByOSName(osName, ip, status, card);
    }

    @Override
    public com.lanou.bean.Service selectByServiceId(int id) {
        return serviceMapper.selectByServiceId(id);
    }

    @Override
    public void updatePauseDate(String pause, int id) {
        serviceMapper.updatePauseDate(pause, id);
    }

    @Override
    public void updateDelPauseDate(String pause, int id) {
        serviceMapper.updateDelPauseDate(pause, id);
    }

    @Override
    public void updateCloseDate(String close, int id) {
        serviceMapper.updateCloseDate(close,id);
    }


}
